#!/usr/bin/perl

package Foo;
#use Class::C3;
use Class::C3::Componentised;

sub new {
    my $class = shift;
    bless{data=>'start:'},$class;
}

sub call{
    my $self = shift;
    $self->{data} .= 'foo:';
    return $self->{data};
}

package Bar1;
use base qw/ Foo /;

sub call{
    my $self = shift;
    $self->{data} .= 'bar1:';
    $self->next::method();
    return $self->{data};
}

sub fee{
    my $self = shift;
    return '10,000 yen';
}

package Bar2;
use base qw/ Foo /;

sub call{
    my $self = shift;
    $self->{data} .= 'bar2:';
    $self->next::method();
    return $self->{data};
}

package Hoge;
#use base qw/ Bar1 Bar2 /;
use base qw/Bar1/;

sub call{
    my $self = shift;
    $self->{data} .= 'hoge:';
    $self->next::method();
    return $self->{data};
}

#Class::C3::initialize();
#my $foo = new Bar();
#my $foo = new Foo();
#unshift @Hoge::ISA,'Bar2';
my $foo = new Hoge();
my $call = $foo->call();
my $fee  = $foo->fee();

print "Call-data:: $call\n";
print "Fee-data:: $fee\n";
print "Bar1-ISA:: @Bar1::ISA\n";
print "Hoge-ISA:: @Hoge::ISA\n";



#sub p($) {
#    my $str = shift;
#    print "$str\n";
#}


#my $t = 'akihito1';
#p $t;
#p 'hoe';



